/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.unwiredgrain.modeling.sscm.impl;

import com.unwiredgrain.modeling.sscm.SSCMPackage;
import com.unwiredgrain.modeling.sscm.TemplateInstantiation;
import com.unwiredgrain.modeling.sscm.TemplateParameter;

import org.eclipse.emf.ecore.EClass;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Template Parameter</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link com.unwiredgrain.modeling.sscm.impl.TemplateParameterImpl#getCppName <em>Cpp Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class TemplateParameterImpl extends NamedElementImpl implements TemplateParameter {
	/**
	 * The default value of the '{@link #getCppName() <em>Cpp Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCppName()
	 * @generated
	 * @ordered
	 */
	protected static final String CPP_NAME_EDEFAULT = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TemplateParameterImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SSCMPackage.Literals.TEMPLATE_PARAMETER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public String getCppName() {
		// DONE: implement this method to return the 'Cpp Name' attribute
		// Ensure that you remove @generated or mark it @generated NOT
		// throw new UnsupportedOperationException();
		// return "derived class should override this method";
		if (getName() == null || getName().isEmpty()) {
			return "[UNSET]";
		}
		return getName();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public abstract boolean isRequiredTemplateArgumentType(TemplateInstantiation arg);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public abstract TemplateInstantiation createTemplateArgumet();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SSCMPackage.TEMPLATE_PARAMETER__CPP_NAME:
				return getCppName();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SSCMPackage.TEMPLATE_PARAMETER__CPP_NAME:
				return CPP_NAME_EDEFAULT == null ? getCppName() != null : !CPP_NAME_EDEFAULT.equals(getCppName());
		}
		return super.eIsSet(featureID);
	}

} //TemplateParameterImpl
